package com.viewshine.nettydemo.springBeanMethod.config;

import com.viewshine.nettydemo.springBeanMethod.config.property.NettyServerConnectObj;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/**
 * @ClassName PropertiesBeanConfig
 * @Author rhb
 * @Description 初始化配置文件中SpringBean相关属性值
 * @Date 2018-12-17
 * @Version 1.0
 **/
@Configuration
@PropertySource(value = {"classpath:config.properties"},
        ignoreResourceNotFound = true,encoding = "utf-8")
public class PropertiesBeanConfig {

    @Bean
    @ConfigurationProperties(prefix = "my.netty.server")
    public NettyServerConnectObj nettyServerConnectObj(){
        return new NettyServerConnectObj();
    }



}
